package com.frame.controller;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.read.listener.ReadListener;
import com.frame.domain.Crop;
import com.frame.service.CropService;

public class UploadDataListener implements ReadListener<Crop> {

    private CropService cropService;

    public UploadDataListener(CropService cropService) {
        this.cropService=cropService;
    }
    public UploadDataListener(Object p0) {

    }

    @Override
    public void invoke(Crop crop, AnalysisContext analysisContext) {
        cropService.insertUsers(crop);
    }

    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {
        System.out.println("--------解析完之后的方法----------");

    }
}

